"""
写添加站内信页面的信息
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class GgtjPage(BasePage):
    url = ("http://192.168.1.55/crm/index.php?m=announcement&a=add")
    bt_locator = (By.NAME, "title")
    neirong_locator = (By.CSS_SELECTOR, ".ke-edit-iframe")
    baocun_locator = (By.XPATH, "/html/body/div[5]/div[2]/div/form/table/tfoot/tr/td/input[1]")
    def bt_input(self,title):
        """标题输入框"""
        self.driver.find_element(*self.bt_locator).send_keys(title)
    def neirong_input(self,content):
        """内容输入框"""
        self.driver.find_element(*self.neirong_locator).send_keys(content)
    def baocun_click(self):
        """点击保存"""
        self.driver.find_element(*self.baocun_locator).click()

    def open(self):
        """打开页面地址"""
        self.driver.get(self.url)